<%--
  Created by IntelliJ IDEA.
  User: 田同学
  Date: 2022/1/11
  Time: 14:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<br><br>
<div style="position: fixed; width: 100%;height:400px;background-color: #999d9d">
    <span><label style="color: #222222">制定物料组成设计单</label></span>
    <br>
    <div class="container" style="position: fixed;left: 50%">
        <div id="div_design"></div>

        <form class="form-inline" id="form_design">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label for="Iselect_design">I&nbsp;级分类：</label><select id="Iselect_design"  class="form-control"style="width: 300px">
            <option value="未选择">---请选择I级分类---</option>

        </select><br><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label >II&nbsp;级分类：</label><select id="IIselect_design" class="form-control "style="width: 300px">
            <option value="">---请选择II级分类---</option>
        </select><br><br>

            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label >III&nbsp;级分类：</label><select id="IIIselect_design" class="form-control "style="width: 300px">
            <option value="">---请选择III级分类---</option>
        </select><br><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            请输入建档日期：<input type="date">到 <input type="date">
            <br><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" id="btnsearch_design" style="width: 500px" value="查询"  data-toggle='modal' data-target='#myModal_design' class="btn btn-success">
        </form>
    </div>
</div>

<!-- 模态框（Modal） -->
<div  class="modal fade" id="myModal_design" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_design" aria-hidden="true">
    <div class="modal-dialog"  style="width: 80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel_design">产品设计-- 产品物料组成设计--制定物料组成设计单</h4>
            </div>
            <div class="modal-body" >
                <div>
                    <table id="query_design">

                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>



<br><br>

<!-- 模态框（Modal 第二个） -->
<div  class="modal fade" id="myModal_design03" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_design03" aria-hidden="true">
    <div class="modal-dialog"  style="width: 80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel_design03">产品设计-- 产品物料组成设计--制定物料组成设计单</h4>
            </div>
            <div class="modal-body" >
                <div>
                    <div style="position: relative;left: 43%"><b style="font-size: 35px">物料组成设计单</b></div>
                    <br><br>
                        <div style="position: relative;left: 80%" id="btn_div">
                            <button class="btn btn-info" data-toggle='modal' data-target='#myModal_design02'>添加物料</button>
                            <button class="btn btn-danger" id="remove_design">删除物料</button>
                            <button class="btn btn-warning" id="btn_div02">预览</button>
                        </div>
                            <div id="btn_design02" >
                                <button id="btn_design" class="btn btn-info" style="position: relative;left: 90%">返回</button>
                                <button id="btn_comit"  class="btn btn-success" style="position: relative;left: 90%">提交</button>
                            </div>
                    <br><br>
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <label>产品名称：</label> <span id="PRODUCT_NAME_design" style="width: 70%"></span>
                        </div>
                        <div class="col-md-6 form-inline" >
                            <div style="position: relative;left: 50%">
                                <label >产品编号：</label > <span  id="PRODUCT_ID_design"></span>
                            </div>
                        </div>
                    </div>
                    <br>
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <label>设计人：</label> <input id="DESIGNER_design"  class="form-control" style="width: 70%">
                        </div>
                    </div>
                    <br>
                    <div id="div_design03"></div>
                    <table id="query_design03">

                    </table>
                    <br><br><br>
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <label>登记人：</label> <input type="text" id="register_design" class="form-control" style="width: 70%">
                        </div>
                        <div class="col-md-6 form-inline" >
                            <div style="position: relative;left: 50%">
                            <label >登记时间：</label > <span id="date_design" ></span>
                            </div>
                        </div>
                    </div>
                    <br>
                    <div>
                        <label style="position: relative;top: -45px">设计要求:</label><textarea id="MODULE_DESCRIBE_dsengin" style="height: 100px;width: 90%"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


<!-- 模态框（Modal） 第三个 -->

<div  class="modal fade" id="myModal_design02" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_design02" aria-hidden="true">
    <div class="modal-dialog"  style="width: 100%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel_design02">产品设计-- 产品物料组成设计--制定物料组成设计单</h4>
            </div>
            <div class="modal-body" >
                        <div id="div_design02"></div>

                        <form id="form_design02" class="form-inline">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <label for="Iselect_design02">I&nbsp;级分类：</label><select id="Iselect_design02"  class="form-control"style="width: 300px">
                            <option value="未选择">---请选择I级分类---</option>

                        </select>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <label >II&nbsp;级分类：</label><select id="IIselect_design02" class="form-control "style="width: 300px">
                            <option value="">---请选择II级分类---</option>
                        </select>

                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <label >III&nbsp;级分类：</label><select id="IIIselect_design02" class="form-control "style="width: 300px">
                            <option value="">---请选择III级分类---</option>
                        </select>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            请输入建档日期：<input type="date">到 <input type="date"><br><br>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" id="btnsearch_design02" style="width: 500px;position: relative;left: 35%" value="查询"   class="btn btn-success">
                        </form>

                <div>
                    <button class='btn btn-info' id="adddesign" data-dismiss="modal">添加物料</button>
                    <table id="query_design02">

                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


<script>
    var params = {
        url: "${pageContext.request.contextPath}/querybyAlldfile.action",
        method: 'GET',                      //请求方式（*）
        toolbar: '#div_design',              //工具按钮用哪个容器
        striped: true,                      //是否显示行间隔色
        cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
        pagination: true,                   //是否显示分页（*）
        sortable: true,                     //是否启用排序
        sortOrder: "asc",                   //排序方式
        sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
        pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录
        pageSize: 5,                     //每页的记录行数（*）
        pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数（*）
        search: false,                      //是否显示表格搜索
        strictSearch: true,
        showColumns: true,                  //是否显示所有的列（选择显示的列）
        showRefresh: true,                  //是否显示刷新按钮
        minimumCountColumns: 2,             //最少允许的列数
        clickToSelect: true,                //是否启用点击选中行
        height: 500,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
        uniqueId: "id",                     //每一行的唯一标识，一般为主键列
        showToggle: true,                   //是否显示详细视图和列表视图的切换按钮
        cardView: false,                    //是否显示详细视图
        detailView: false,                  //是否显示父子表
        //传递额外的查询用的参数
        queryParams: function (params) {
            //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            var I=$("#Iselect_design").val();
            var temp = {
                pagesize: params.limit,     //页面大小
                pageno: (params.offset / params.limit) + 1,   //页码
                //查询条件
                firstKindId:I.substring(0,2),
                type:"Y001-1",
                designProcedureTag:"W001-0",
                secondKindName:$("#IIselect_design option:selected").text(),
                thirdKindName:$("#IIIselect_design option:selected").text()
            };
            return temp;
        },
        columns: [
            // {
            //     title: "全选",
            //     field: "",
            //     checkbox:true
            // },
            {
                title: "产品编号",
                field: "productId",
            },
            {
                title: "产品名称",
                field: "productName"
            },
            {
                title:"档次级别",
                field: "productClass",
                formatter:function (value) {
                    if (value=="D001-1"){
                        return"高档";
                    }else
                    if (value=="D001-2"){
                        return"中档";
                    }else
                    if (value=="D001-3"){
                        return"低档";
                    }
                }
            },
            {
                title: "用途类型",
                field: "type",
                formatter:function (value) {
                    if (value=="Y001-1"){
                        return "商品";
                    }else
                    if (value=="Y001-2"){
                        return "物料";
                    }
                }
            },
            {
                title: "I分类",
                field: "firstKindName",
            },
            {
                title: "II分类",
                field: "secondKindName",
            },
            {
                title: "III分类",
                field: "thirdKindName",
            },
            {
                title: "制定设计单",
                field: "",
                formatter:function (value,row,index) {
                    return"<button class='btn btn-info' data-toggle='modal' data-target='#myModal_design03' onclick='design_id("+row.id+")'>制定设计单</button>";
                }
            }
        ]
    };
    $("#query_design").bootstrapTable(params);
    $("#btnsearch_design").click(function () {
        $("#query_design02").bootstrapTable("refresh");
        //条件查询
        //刷新表格数据
        $("#query_design").bootstrapTable("refresh");
        setTimeout(function () {
            $("#form_design").resetForm();
        },5000)


    })
    var dModule;
    function design_id(id){
        $.get("${pageContext.request.contextPath}/dfilebyid.action",{id:id},
        function (data) {
            console.log(data)
            $("#PRODUCT_NAME_design").text(data.productName)
            $("#PRODUCT_ID_design").text(data.productId)
            $("#register_design").val(data.register)
            dModule={
                id:data.id,
                productId:data.productId,
                productName:data.productName,
                firstKindId:data.firstKindId,firstKindName:data.firstKindName,secondKindId:data.secondKindId,
                secondKindName:data.secondKindName,thirdKindId:data.thirdKindId,thirdKindName:data.thirdKindName,
                designer:$("#DESIGNER_design").val(),registerTime: $("#date_design").text(),
                moduleDescribe:$("#MODULE_DESCRIBE_dsengin").val(),register:data.register,
                checkTag:"S001-0",changeTag:"B002-0",
            }
        }
        ,"json");

        //提交
        $("#btn_comit").click(function () {
            var arr= $("#query_design03").bootstrapTable("getData");
            var trs= $("#query_design03 tr");
            var dModuleDetails=[];
            $(arr).each(function (index,item) {
                var temp={
                    productId:item.productId,
                    productName:item.productName,
                    type:item.type,
                    productDescribe:item.productDescribe,
                    amountUnit:item.amountUnit,
                    amount:$(trs[index+1]).find("input[name='num_design']").val(),
                    residualAmount:$(trs[index+1]).find("input[name='num_design']").val(),
                    costPrice:item.costPrice,
                    //subtotal:"123.00"
                }
                dModuleDetails.push(temp)
            })
            dModule["details"]=dModuleDetails;
            var param={
                url:"${pageContext.request.contextPath}/insertDmodule.action",
                type:"put",
                data:JSON.stringify(dModule),
                dataType:"json",
                contentType:"application/json",
                success:function (data) {
                    alert(data.msg)
                    if (data.code>0){
                        $("#query_design").bootstrapTable("refresh");
                        $("#myModal_design03").modal("hide");
                        //$("#query_design03").bootstrapTable("remove");

                    }
                }
            }
            $.ajax(param)
        })
        //当前时间
        $(document).ready(function () {
            var starDate =new Date();
            $("#date_design").text(starDate.getFullYear()
                +"-"+starDate.getMonth()+1
                +"-"+starDate.getDate()
                +" "+starDate.getHours()
                +":"+starDate.getMinutes()
                +":"+starDate.getSeconds()
            )
        })

    }

    inln01_design(0)
    //获取下拉框值
    function inln01_design(pId){
        var pId={pId:pId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            pId,
            function (data) {
                console.log(data)
                //循环
                $(data).each(function (index,item) {
                    var option=$("<option value='"+item.kindId+""+item.id+"'>"+item.kindName+"</option>")
                    $("#Iselect_design").append(option)

                })
                $("#Iselect_design").blur(function () {
                    $("#IIselect_design>option:gt(0)").remove()
                    $("#IIIselect_design>option:gt(0)").remove()
                    var fir=$("#Iselect_design").val()
                    inln2_design(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }


    //第二个下拉框
    function inln2_design(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIselect_design>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIselect_design").append(option)
                })
                $("#IIselect_design").blur(function () {
                    var fir=$("#IIselect_design").val()
                    inln3_design(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }

    //第三个下拉框
    function inln3_design(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIIselect_design>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIIselect_design").append(option)
                })

            }),'json'
    }

    //物料查询
    var params = {
        url: "${pageContext.request.contextPath}/querybyAlldfile.action",
        method: 'GET',                      //请求方式（*）
        toolbar: '#div_design02',              //工具按钮用哪个容器
        striped: true,                      //是否显示行间隔色
        cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
        pagination: true,                   //是否显示分页（*）
        sortable: true,                     //是否启用排序
        sortOrder: "asc",                   //排序方式
        sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
        pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录
        pageSize: 5,                     //每页的记录行数（*）
        pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数（*）
        search: false,                      //是否显示表格搜索
        strictSearch: true,
        showColumns: true,                  //是否显示所有的列（选择显示的列）
        showRefresh: true,                  //是否显示刷新按钮
        minimumCountColumns: 2,             //最少允许的列数
        clickToSelect: true,                //是否启用点击选中行
        height: 500,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
        uniqueId: "id",                     //每一行的唯一标识，一般为主键列
        showToggle: true,                   //是否显示详细视图和列表视图的切换按钮
        cardView: false,                    //是否显示详细视图
        detailView: false,                  //是否显示父子表
        //传递额外的查询用的参数
        queryParams: function (params) {
            //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            var I=$("#Iselect_design02").val();
            var temp = {
                pagesize: params.limit,     //页面大小
                pageno: (params.offset / params.limit) + 1,   //页码
                //查询条件
                firstKindId:I.substring(0,2),
                type:"Y001-2",
                secondKindName:$("#IIselect_design02 option:selected").text(),
                thirdKindName:$("#IIIselect_design02 option:selected").text()
            };
            return temp;
        },
        columns: [
            {
                title: "全选",
                field: "",
                checkbox:true
            },
            {
                title: "产品编号",
                field: "productId",
            },
            {
                title: "物料名称",
                field: "productName"
            },
            {
                title: "用途类型",
                field: "type",
                formatter:function (value) {
                    if (value=="Y001-1"){
                        return "商品";
                    }else
                    if (value=="Y001-2"){
                        return "物料";
                    }
                }
            },
            {
                title: "物料描述",
                field: "productDescribe",
                formatter:function (value) {
                    if (value==""){
                        return "无";
                    }
                }
            },
            {
                title: "单位",
                field: "amountUnit",
            },
            {
                title: "计划成本",
                field: "costPrice",
            },
        ]
    };

    $("#query_design02").bootstrapTable(params);

    $("#btnsearch_design02").click(function () {
        //条件查询
        //刷新表格数据

        $("#query_design02").bootstrapTable("refresh");
        setTimeout(function () {
            $("#form_design02").resetForm();
        },5000)


    })
    //添加物料
    $("#adddesign").click(function () {

            na_de= $("#query_design02").bootstrapTable("getAllSelections");
            $("#query_design03").bootstrapTable("load",na_de)
            alert("添加成功")

    })
    //删除物料
    $("#remove_design").click(function () {
        var obj=$("#query_design03");

        var id=$.map(obj.bootstrapTable("getSelections"),function (row) {
            return row.id;
        })
        obj.bootstrapTable("remove",{field:'id',values:id});
    })



    inln01_design02(0)
    //获取下拉框值
    function inln01_design02(pId){
        var pId={pId:pId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            pId,
            function (data) {
                console.log(data)
                //循环
                $(data).each(function (index,item) {
                    var option=$("<option value='"+item.kindId+""+item.id+"'>"+item.kindName+"</option>")
                    $("#Iselect_design02").append(option)

                })
                $("#Iselect_design02").blur(function () {
                    $("#IIselect_design02>option:gt(0)").remove()
                    $("#IIIselect_design02>option:gt(0)").remove()
                    var fir=$("#Iselect_design02").val()
                    inln2_design02(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }


    //第二个下拉框
    function inln2_design02(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIselect_design02>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIselect_design02").append(option)
                })
                $("#IIselect_design02").blur(function () {
                    var fir=$("#IIselect_design02").val()
                    inln3_design02(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }

    //第三个下拉框
    function inln3_design02(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIIselect_design02>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIIselect_design02").append(option)
                })

            }),'json'
    }


    //第三个table
    var params = {
    <%--    url: "${pageContext.request.contextPath}/querybyAlldfile.action",--%>
        method: 'GET',                      //请求方式（*）
    <%--    toolbar: '#div_design03',              //工具按钮用哪个容器--%>
        striped: true,                      //是否显示行间隔色
    <%--    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）--%>
    <%--    pagination: true,                   //是否显示分页（*）--%>
    <%--    sortable: true,                     //是否启用排序--%>
    <%--    sortOrder: "asc",                   //排序方式--%>
    <%--    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）--%>
    <%--    pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录--%>
    <%--    pageSize: 5,                     //每页的记录行数（*）--%>
    <%--    pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数（*）--%>
    <%--    search: false,                      //是否显示表格搜索--%>
    <%--    strictSearch: true,--%>
    <%--    showColumns: true,                  //是否显示所有的列（选择显示的列）--%>
        showRefresh: true,                  //是否显示刷新按钮
        minimumCountColumns: 2,             //最少允许的列数
        clickToSelect: true,                //是否启用点击选中行
        height: 200,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
    <%--    uniqueId: "id",                     //每一行的唯一标识，一般为主键列--%>
    <%--    showToggle: true,                   //是否显示详细视图和列表视图的切换按钮--%>
    <%--    cardView: false,                    //是否显示详细视图--%>
    <%--    detailView: false,                  //是否显示父子表--%>
    <%--    //传递额外的查询用的参数--%>
    <%--    queryParams: function (params) {--%>
    <%--        //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的--%>
    <%--        var temp = {--%>
    <%--            pagesize: params.limit,     //页面大小--%>
    <%--            pageno: (params.offset / params.limit) + 1,   //页码--%>

    <%--        };--%>
    <%--        return temp;--%>
    <%--    },--%>
        columns: [
            {
                title: "全选",
                field: "",
                checkbox:true
            },
            {
                title: "物料编号",
                field: "productId",
            },
            {
                title: "物料名称",
                field: "productName"
            },
            {
                title:"描述",
                field: "productDescribe",
            },
            {
                title: "用途类型",
                field: "type",
                formatter:function (value) {
                    if (value=="Y001-1"){
                        return "商品";
                    }else
                    if (value=="Y001-2"){
                        return "物料";
                    }
                }
            },
            {
                title: "数量",
                field: "",
                formatter:function(value){

                    return"<input type='number' required='true' placeholder='请输入数量'  name='num_design'  class='form-control'>";
                }
            },
            {
                title: "单位",
                field: "amountUnit",
            },
            {
                title: "计划成本单价",
                field: "costPrice",
            },
            {
                title: "小计",
                field: "",
                formatter:function (value,row,index) {

                }
            }
        ]
    };
    $("#query_design03").bootstrapTable(params);




    //按钮
    $("#btn_design02").hide();

    $("#btn_div02").click(function () {
        var arr= $("#query_design03").bootstrapTable("getData");
        var trs= $("#query_design03 tr");
        console.log(arr)
        if (arr.length!=0){
            $(arr).each(function (index,item) {
                //alert($(trs[index+1]).find("input[name='num_design']").val())
                if ($(trs[index+1]).find("input[name='num_design']").val()!=""){
                    $("#btn_design02").show();
                    $("#btn_div").hide();
                }
            })


        }


    })
    $("#btn_design").click(function () {
        $("#btn_div").show();
        $("#btn_design02").hide();
    })

</script>
</body>
</html>
